Skip to content

test: add 5 test files covering uncovered code paths (V-9599) - #303

Merged
wyu71 merged 1 commit into
linuxdeepin:masterfrom
wyu71:agent/ut-bot/7ece696408dd
Nov 30, 2026
Merged

wyu71 merged 1 commit into
linuxdeepin:masterfrom
wyu71:agent/ut-bot/7ece696408dd

Conversation

@wyu71

@wyu71 wyu71 commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add 5 unit test files (67 test cases total) covering uncovered code paths identified by lcov analysis (V-9599).

Test Files

  • test_pen_line_rect_coverage.cpp: CGraphicsPenItem (drawComplete, smooth vector, rect shift, paintSelf, getHighLightPath, cache reset), CGraphicsLineItem (doScaling group), CGraphicsRectItem (paintSelf preview)
  • test_cgraphicslayer_coverage.cpp: CGraphicsLayer::setRect no-intersection, creatCmd(2/3), setAttributionVar(EImageAdaptScene), addPenPath blocked/type=0/resize
  • test_cdrawscene_cgraphicsview_coverage.cpp: PageScene (getGroupTreeInfo, assignmentZ, getSameGroup, firstItem incW/seeNodeAsBzItem, doLeave, zValueSortASC), PageView (contextMenuEvent)
  • test_cgraphicsitem_textitem_undoredomgr_coverage.cpp: CGraphicsItem (creatItemInstance, zItem, setScene, hitTest, isRectPenetrable, operating blur, itemChange blur, paintBlur), CGraphicsTextItem (changToEditState, setTextState, updateToDefaultTextFormat, paint), CUndoRedoCommand (getCmdByItemCmdInfo, CBzItemAllCommand::parsingVars, CCmdBlock, CSceneGroupChangedCommand undo), CGraphicsItemGroup (drawZValue, testOpetating, doScalEnd, loadGraphicsUnit, getLogicFirst, updateHandlesGeometry)
  • test_ccentralwidget_cviewmgmt_misc_coverage.cpp: DrawBoard (onFileContextChanged, loadImage), CFileWatcher (file modified), FileSelectDialog (extractSuffix), IDrawTool (toolDoStart dblclick, toolDoUpdate touch radius, refresh popup)

Test Results

All 67 tests pass under QT_QPA_PLATFORM=offscreen with no modifications to business code (src/).

Summary by Sourcery

Tests:

  • Add five unit-test suites covering previously untested drawing items, graphics layers, scenes and views, text and undo/redo handling, and central view-management paths.

@sourcery-ai

sourcery-ai Bot commented Nov 27, 2026

Copy link
Copy Markdown

Sorry @wyu71, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 2 days and 9 hours by commenting @sourcery-ai review. Upgrade to get a review now.

Add unit tests for 5 groups of uncovered code paths

Issue: V-9599
Log: add 5 test files covering uncovered code paths
@wyu71
wyu71 force-pushed the agent/ut-bot/7ece696408dd branch from 64c5ffe to de0e137 Compare November 30, 2026 02:44
@sourcery-ai

sourcery-ai Bot commented Nov 30, 2026

Copy link
Copy Markdown

Reviewer's Guide

Tests

Add coverage tests for pen, line, and rectangle item rendering and geometry paths.

  • tests/test_pen_line_rect_coverage.cpp L1-328

Add coverage tests for graphics-layer resizing, command creation, attribution, and pen-path handling.

  • tests/test_cgraphicslayer_coverage.cpp L1-141

Add coverage tests for PageScene and PageView grouping, sorting, hit-testing, leave, and context-menu paths.

  • tests/test_cdrawscene_cgraphicsview_coverage.cpp L1-339

Add coverage tests for graphics items, text items, undo/redo commands, and graphics-item-group behavior.

  • tests/test_cgraphicsitem_textitem_undoredomgr_coverage.cpp L1-843

Add coverage tests for DrawBoard, file watching and selection, and draw-tool event paths.

  • tests/test_ccentralwidget_cviewmgmt_misc_coverage.cpp L1-316

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: lzwind, wyu71

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wyu71
wyu71 merged commit 27c9130 into linuxdeepin:master Nov 30, 2026
14 checks passed
@wyu71
wyu71 deleted the agent/ut-bot/7ece696408dd branch November 30, 2026 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants